-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix typecastValue
and typecastAttributes
methods in AttributeTypecastBehavior
#19528
Conversation
…ecastBehavior` - `AttributeTypecastBehavior::typecastValue()`: `$type` callback can be string - `AttributeTypecastBehavior::typecastAttributes`: typecast only active attributes
@rob006 smiles not informative, can you explain your position? |
Your PR description is laconic and does not explain what use case you're trying to fix. And I see big potential for BC breaks and footguns ( |
it's because my English not so good :(
fixes error at using stringable callbacks
filters passed attributes to skip type casting unactive attributes
|
Which obviously breaks BC, since you even needed to adjust unit tests.
So if someone has |
@rob006 > If we want to support string callbacks, built-in typecasts should have precedence and call_user_func() should be used for everything else.
type casting unactive attributes is bug
I'm just fixed incomplete test model - active attribute must be
agree, fixed |
Why? This "bug" was covered by tests.
There is still problematic |
as you can see, changes too covered, I'm just add missed rule
what's problem? |
Closing since that's very likely result in a big BC break. |
AttributeTypecastBehavior::typecastValue()
:$type
callback can be stringAttributeTypecastBehavior::typecastAttributes
: typecast only active attributes